package com.jtfr.controller;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.framework.annotation.RequestMapping;
import com.framework.annotation.RequestMapping.RequestMethod;
import com.framework.annotation.Controller;
import com.framework.annotation.Autowired;
import com.framework.bean.Data;
import com.framework.bean.Param;
import com.jtfr.service.TestService;

@Controller
public class TestContorller {

	private static Logger LOGGER = LoggerFactory.getLogger(TestContorller.class);
	
	@Autowired
	private TestService testService;
	
	@RequestMapping(value="/test", method=RequestMethod.POST)
	public Data test(Param param) {
		Map<String, Object> map = param.getMap();
		LOGGER.info("map : "+map.get("name"));
		LOGGER.info("POST进入了");
		testService.test();
		return new Data("好的");
	}
	
	@RequestMapping(value="/test", method=RequestMethod.GET)
	public Data test2() {
		//Map<String, Object> map = param.getMap();
		//LOGGER.info("map : "+map.get("name"));
		LOGGER.info("GET进入了");
		testService.test();
		return new Data("好的");
	}
	
	@RequestMapping(value="/test", method=RequestMethod.PUT)
	public Data test3() {
		//Map<String, Object> map = param.getMap();
		//LOGGER.info("map : "+map.get("name"));
		LOGGER.info("PUT进入了");
		testService.test();
		return new Data("好的");
	}
	
	@RequestMapping(value="/test", method=RequestMethod.DELETE)
	public Data test4() {
		//Map<String, Object> map = param.getMap();
		//LOGGER.info("map : "+map.get("name"));
		LOGGER.info("DELETE进入了");
		testService.test();
		return new Data("好的");
	}
}
